import { React, useEffect, useState } from 'react';
const Index = () => {
  const [count, set_count] = useState('loding');
  useEffect(() => {
    setTimeout(() => {
      set_count('success');
    }, 3000);
  }, []);
  useEffect(() => {
    if (count === 'loding') {
      setTimeout(() => {
        set_count('success');
      }, 3000);
    }
  }, [count]);
  const handclick = () => {
    set_count('loding');
  };
  return (
    <>{count === 'success' ? <button onClick={handclick}>btn</button> : ''}</>
  );
};

export default Index;
